package com.dws.xchat.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.dws.xchat.bean.User;

@Mapper
public interface UserDao {
	@Select("select count(1) from user where username=#{username}")
	public int isUserExist(@Param("username")String username);
	
	@Select("select * from user where username=#{username}")
	public User findUser(@Param("username")String username);
	
	@Insert("insert into user(username,password)values(#{user.username},#{user.password})")
	public void registUser(@Param("user")User user);
}
